#ifndef __XRP_CB_IMPL_H__
#define __XRP_CB_IMPL_H__

#include "baseCallbacks.h"
#include "baseTimeoutCallBack.h"

#ifndef send_directed_pres
#define send_directed_pres(_parser,from,to,msg) do{\
  iks *x = NULL; \
  const char *const t = "chat"; \
  x = iks_new ("presence"); \
  if( NULL == x ) \
    break; \
  iks_insert_attrib (x, "from", (const char *) (from) ); \
  iks_insert_attrib (x, "to", (const char *) (to) ); \
  if(t) iks_insert_cdata (iks_insert (x, "show"), t, 0); \
  if(msg) iks_insert_cdata(iks_insert (x, "status"), (const char*)(msg), 0); \
  iks_send((iksparser*)(_parser), x);\
  iks_delete(x);\
} while(0)
#endif

class callBackImpl : public baseCallbacks
{
  public:
    callBackImpl(std::string &statusMessage);
    virtual xret handleMessage(const char *from,const char *msg,
                                char *wdata, size_t *len);
    virtual xret handleBind(char *msg, size_t *len);
    virtual xret handleIq(iksparser *parser,ikspak *pak);
    virtual xret handlePresence(iksparser *parser,ikspak *pak);
    virtual ~callBackImpl();
  protected:
  private:
    std::string statMsg;
};
#endif
/*
vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=2:encoding=utf-8:textwidth=80
*/
